<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //模板字符串
        let name = `李泽言`;
        let sayHello = `Hello,我的名字叫${name}`;
        alert(sayHello);

        //可以换行，显示比较好
        let result = {
            name: '李泽言',
            age:22,
        };
        let html = `
        <div>
            <span>${result.name}</span>
            <span>${result.age}</span>
        </div>
        `
        console.log(html);

        //可以调用函数
        const fn = () => {
            return '我说fn函数';
        };
        let fun = `我是模板字符串，${fn()}`;
        console.log(fun);
    </script>
</body>
</html>